package com.xueyi.game.backend.entity.dto;

import com.xueyi.core.base.PageLimitReq;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import javax.validation.constraints.NotNull;

/**
 * @author hxs
 * @createDate 2022/11/24 11:06
 * @description 获取用户操作日志列表
 */
@Data
public class FindUserLogByUserIdDto extends PageLimitReq {

    @NotNull(message = "参数异常")
    private Integer id;
    private String startTime;
    private String endTime;

    public void format() {
        if (StringUtils.isBlank(startTime) || StringUtils.isBlank(endTime)) {
            startTime = null;
            endTime = null;
        } else {
            startTime += " 00:00:00";
            endTime += " 23:59:59";
        }
    }
}
